#pragma once
#include "Player.h"

Player::Player() {
	tex.initialize(L"\images\test.png",true);
	stats.str = 0;
	stats.health = 0;
	stats.tough = 0;
	stats.agil = 0;
	stats.weight = 0;
	orientation = NORTH;
	speed = 300.0f;

	pInput = Input::getInstance();
}

Player::~Player() {
	pInput->release();
}

void Player::Update(float dT) {
	// Movement
	if(pInput->keyDown(DIK_W)) {
		position.y -= speed * dT;
	}
	if(pInput->keyDown(DIK_S)) {
		position.y += speed * dT;
	}
	if(pInput->keyDown(DIK_A)) {
		position.x -= speed * dT;
	}
	if(pInput->keyDown(DIK_D)) {
		position.x += speed * dT;
	}
	// Facing
	if(pInput->keyPressed(DIK_UP)) {
		orientation = NORTH;
	}
	if(pInput->keyPressed(DIK_DOWN)) {
		orientation = SOUTH;
	}
	if(pInput->keyPressed(DIK_LEFT)) {
		orientation = WEST;
	}
	if(pInput->keyPressed(DIK_RIGHT)) {
		orientation = EAST;
	}
	setFacing(orientation);
	DX2DEngine::getInstance()->setCamera(position);
}